package com.exam.commonbiz.bean;

import android.text.TextUtils;

import com.exam.commonbiz.util.DateUtil;

import java.io.Serializable;

/**
 * @Author yuexingxing
 * @time 2020/7/2
 */
public class UserInfo implements Serializable {

    public String id;
    public String phone;
    public String password;
    public String childPhone;
    public String activateCode;
    public String expirationTime;
    public String enable;
    public String deviceToken;
    public String token;

    /**
     * 是否需要去激活
     * 激活码为空，或者已过期
     *
     * @return
     */
    public static boolean needActive(String expirationTime) {
        if (TextUtils.isEmpty(expirationTime)) {
            return true;
        } else if (expirationTime.compareTo(DateUtil.getCurrentTime()) < 0) {
            return true;
        } else {
            return false;
        }
    }
}
